#! /bin/sh -vx
# $Id$
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2014 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

W2CDir=${W2CDir:-..}
BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_pltotf=$W2CDir/pltotf$ExeExt
_omfonts=$BinDir/omfonts$ExeExt

tests=tests

test -d $tests || mkdir -p $tests

TEXMFCNF=$srcdir/../../kpathsea
export TEXMFCNF

echo && echo "pltotf $tests/shorten.opl $tests/shortend.tfm" && \
  $_pltotf $srcdir/$tests/shorten.opl $tests/shortend.tfm || exit

echo && echo "omfonts -ofm2opl $tests/shorten.tfm $tests/shortend.pl" && \
  $_omfonts -ofm2opl $tests/shortend.tfm $tests/shortend.pl || exit

echo && echo "omfonts -opl2ofm $tests/shorten $tests/shortend" && \
  $_omfonts -opl2ofm $srcdir/$tests/shorten $tests/shortend || exit

echo && echo "omfonts -ofm2opl $tests/shorten $tests/shortend" && \
  $_omfonts -ofm2opl $tests/shortend $tests/shortend || exit

diff $tests/shortend.pl $tests/shortend.opl || exit

